<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="fr.p10.miage.gestionabsence.model.Intervenant"%>
<%@page import="fr.p10.miage.gestionabsence.model.Etudiant"%>
<jsp:useBean id="utilisateur" class="fr.p10.miage.gestionabsence.model.Utilisateur" scope="session"/>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<!DOCTYPE html>
<html lang="fr">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
        <link rel="shortcut icon" href="">
        <title></title>
        <link href="css/bootstrap.css" rel="stylesheet">
        <link href="css/font-awesome.css" rel="stylesheet">
        <link href="css/index-bo.css" rel="stylesheet">
    </head>
  
    <body class="skin-black fixed">
        <header class="header">
            <a href="accueilEtudiant.jsp" class="logo">MIAGE NANTERRE</a>
            <nav class="navbar navbar-static-top" role="navigation">
                <a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <div class="navbar-right">
                    <ul class="nav navbar-nav">
                        <li class="dropdown user user-menu">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <i class="glyphicon glyphicon-user"></i>
                                <span><%= utilisateur.getPrenom()%> <%= utilisateur.getNom()%> <i class="caret"></i></span>
                            </a>
                            <ul class="dropdown-menu dropdown-menu-right" role="menu" aria-labelledby="dropdownMenu1">
                                <li role="presentation"><a role="menuitem" tabindex="-1" href="profil.jsp"><i class="glyphicon glyphicon-info-sign"></i> Profil</a></li>
                                <li role="presentation"><a href="deconnexion.do" role="menuitem" tabindex="-1"><i class="glyphicon glyphicon-log-out"></i> Déconnexion</a></li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </nav>
        </header>
        <div class="wrapper row-offcanvas row-offcanvas-left">
            <aside class="left-side sidebar-offcanvas">                
                <section class="sidebar">
                    <ul class="sidebar-menu">
                        <li>
                            <a href="../../index.html">
                                <i class="fa fa-dashboard"></i> <span>Tableau de bord</span>
                            </a>
                        </li>
                        <li class="treeview">
                            <a href="#">
                                <i class="fa fa-folder"></i> <span>Absence</span>
                                <i class="fa fa-angle-left pull-right"></i>
                            </a>
                            <ul class="treeview-menu">
                                 <%
                                    if (utilisateur instanceof Etudiant) {
                                %>
                                    <li><a href="accueilEtudiant.do"><i class="fa fa-angle-double-right"></i> Aujourd'hui</a></li>
                                    <li><a href="history.jsp"><i class="fa fa-angle-double-right"></i> Historique</a></li>
                                    <li><a href="parametres.jsp"><i class="fa fa-angle-double-right"></i> Paramètres</a></li>
                                <%  
                                    } else if (utilisateur instanceof Intervenant) {       
                                %>
                                    <li><a href="absenceNowIntervenant.do"><i class="fa fa-angle-double-right"></i> Aujourd'hui</a></li>
                                    <li><a href="history.jsp"><i class="fa fa-angle-double-right"></i> Historique</a></li>
                                    <li><a href="parametres.jsp"><i class="fa fa-angle-double-right"></i> Paramètres</a></li>   
                                <% 
                                    }
                                %>  
                            </ul>
                        </li>
                    </ul>
                </section>
            </aside>
         <aside class="right-side">                
            <section class="content-header">
               <h1>
                  <span class="glyphicon glyphicon-info-sign"></span> Profil 
               </h1>
            </section>
            <section class="content">         
               <table class="table table-hover table-striped">
                  <tbody>
                     <tr>
                        <th><span class="glyphicon glyphicon-user"></span></th><td><%= utilisateur.getPrenom()%> <%= utilisateur.getNom()%></td>
                     </tr>  
                     <tr>
                        <th><span class="glyphicon glyphicon-envelope"></span></th><td><%= utilisateur.getMail()%></td>
                     </tr>
                     <%
                        if (utilisateur instanceof Intervenant) {
                            Intervenant intervenant= (Intervenant) utilisateur;
                     %>
                            <tr>
                                <th><span class="glyphicon glyphicon-earphone"></span></th><td><%= intervenant.getTel()%></td>
                            </tr>
                        <%
                            if (intervenant.getEnService().equals("true")) {
                        %>
                                <tr>
                                    <th><span>En service</span></th><td><span class="glyphicon glyphicon-ok"></span></td>
                                </tr>
                        <%  
                            } else{       
                        %> 
                                <tr>
                                    <th><span>En service</span></th><td><span class="glyphicon glyphicon-remove"></span></td>
                                </tr>
                        <% 
                            }
                        %> 
                            <tr>
                                <th><span>Statut</span></th><td></td>
                            </tr>
                      <%  
                        } else if (utilisateur instanceof Etudiant) {  
                          Etudiant etudiant = (Etudiant) utilisateur;
                      %>                                   
                            <tr>
                                <th><span>Promotion</span></th><td><%= etudiant.getPromotionId()%></td>
                            </tr>
                     <% 
                        }
                     %>          
                  </tbody>
               </table>
            </section>
         </aside>
      </div>

    <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> 
    <script src="js/bootstrap.js"/></script>
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
    <script src="js/app.js"/></script>
</body>
</html>